bitkeeper revision 1.1381 (426ccd3chFZ3jThNSK9--Zvf3r2fug)
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Mon, 25 Apr 2005 10:58:04 +0000 (10:58 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Mon, 25 Apr 2005 10:58:04 +0000 (10:58 +0000)
No longer disable format checking for printf/printk statements. This
required a whole bunch of cleanups to get the build working again.
Signed-off-by: Keir Fraser <keir@xensource.com>
23 files changed:
xen/arch/x86/Rules.mk
xen/arch/x86/audit.c
xen/arch/x86/domain.c
xen/arch/x86/domain_build.c
xen/arch/x86/e820.c
xen/arch/x86/extable.c
xen/arch/x86/mm.c
xen/arch/x86/shadow.c
xen/arch/x86/time.c
xen/arch/x86/traps.c
xen/arch/x86/vmx.c
xen/arch/x86/vmx_intercept.c
xen/arch/x86/x86_32/traps.c
xen/arch/x86/x86_64/mm.c
xen/arch/x86/x86_64/traps.c
xen/common/dom_mem_ops.c
xen/common/grant_table.c
xen/common/multicall.c
xen/common/page_alloc.c
xen/include/asm-x86/mm.h
xen/include/asm-x86/shadow.h
xen/include/asm-x86/x86_32/page.h
xen/include/xen/lib.h

index 370bf3d0a8d14417ec6a347cb629fa1bea0b92a5..915a646bed466797580ed1fbe522ac4bd948ebf9 100644 (file)
@@ -2,7 +2,7 @@
 # x86-specific definitions
 
 CFLAGS  += -nostdinc -fno-builtin -fno-common -fno-strict-aliasing
-CFLAGS  += -iwithprefix include -Wall -Werror -Wno-format -pipe
+CFLAGS  += -iwithprefix include -Wall -Werror -pipe
 CFLAGS  += -I$(BASEDIR)/include -Wno-pointer-arith -Wredundant-decls
 
 ifeq ($(optimize),y)
index 72c0d0b622a3293923f096003d5eb2409f5587c6..2df4d69be8097681e5da109a42129fb87b8d8ed0 100644 (file)
@@ -64,23 +64,25 @@ int audit_adjust_pgtables(struct domain *d, int dir, int noisy)
 
             if ( page_get_owner(page) == NULL )
             {
-                APRINTK("adjust(mfn=%p, dir=%d, adjtype=%d) owner=NULL",
+                APRINTK("adjust(mfn=%lx, dir=%d, adjtype=%d) owner=NULL",
                         page_to_pfn(page), dir, adjtype);
                 errors++;
             }
 
             if ( tcount < 0 )
             {
-                APRINTK("Audit %d: type count went below zero mfn=%x t=%x ot=%x",
-                        d->id, page-frame_table,
+                APRINTK("Audit %d: type count went below zero "
+                        "mfn=%lx t=%x ot=%x",
+                        d->id, page_to_pfn(page),
                         page->u.inuse.type_info,
                         page->tlbflush_timestamp);
                 errors++;
             }
             else if ( (tcount & ~PGT_count_mask) != 0 )
             {
-                APRINTK("Audit %d: type count overflowed mfn=%x t=%x ot=%x",
-                        d->id, page-frame_table,
+                APRINTK("Audit %d: type count overflowed "
+                        "mfn=%lx t=%x ot=%x",
+                        d->id, page_to_pfn(page),
                         page->u.inuse.type_info,
                         page->tlbflush_timestamp);
                 errors++;
@@ -97,16 +99,18 @@ int audit_adjust_pgtables(struct domain *d, int dir, int noisy)
 
         if ( count < 0 )
         {
-            APRINTK("Audit %d: general count went below zero mfn=%x t=%x ot=%x",
-                    d->id, page-frame_table,
+            APRINTK("Audit %d: general count went below zero "
+                    "mfn=%lx t=%x ot=%x",
+                    d->id, page_to_pfn(page),
                     page->u.inuse.type_info,
                     page->tlbflush_timestamp);
             errors++;
         }
         else if ( (count & ~PGT_count_mask) != 0 )
         {
-            APRINTK("Audit %d: general count overflowed mfn=%x t=%x ot=%x",
-                    d->id, page-frame_table,
+            APRINTK("Audit %d: general count overflowed "
+                    "mfn=%lx t=%x ot=%x",
+                    d->id, page_to_pfn(page),
                     page->u.inuse.type_info,
                     page->tlbflush_timestamp);
             errors++;
@@ -133,7 +137,7 @@ int audit_adjust_pgtables(struct domain *d, int dir, int noisy)
                     {
                         if ( page_get_owner(l1page) != NULL )
                         {
-                            printk("L2: Bizarre shadow L1 page mfn=%p "
+                            printk("L2: Bizarre shadow L1 page mfn=%lx "
                                    "belonging to a domain %p (id=%d)\n",
                                    l1mfn,
                                    page_get_owner(l1page),
@@ -146,7 +150,7 @@ int audit_adjust_pgtables(struct domain *d, int dir, int noisy)
                     {
                         if ( page_get_owner(l1page) != d )
                         {
-                            printk("L2: Skip bizarre L1 page mfn=%p "
+                            printk("L2: Skip bizarre L1 page mfn=%lx "
                                    "belonging to other dom %p (id=%d)\n",
                                    l1mfn,
                                    page_get_owner(l1page),
@@ -160,14 +164,14 @@ int audit_adjust_pgtables(struct domain *d, int dir, int noisy)
                         if ( page_type == PGT_l2_page_table )
                         {
                             printk("Audit %d: [%x] Found %s Linear PT "
-                                   "t=%x mfn=%p\n",
+                                   "t=%x mfn=%lx\n",
                                    d->id, i, (l1mfn==mfn) ? "Self" : "Other",
                                    l1page->u.inuse.type_info, l1mfn);
                         }
                         else if ( page_type != PGT_l1_page_table )
                         {
-                            printk("Audit %d: [L2 mfn=%p i=%x] "
-                                   "Expected L1 t=%x mfn=%p\n",
+                            printk("Audit %d: [L2 mfn=%lx i=%x] "
+                                   "Expected L1 t=%x mfn=%lx\n",
                                    d->id, mfn, i,
                                    l1page->u.inuse.type_info, l1mfn);
                             errors++;
@@ -218,8 +222,8 @@ int audit_adjust_pgtables(struct domain *d, int dir, int noisy)
                 {
                     if ( page_get_owner(gpage) != d )
                     {
-                        printk("Audit %d: [hl2mfn=%p,i=%x] Skip foreign page "
-                               "dom=%p (id=%d) mfn=%p c=%08x t=%08x\n",
+                        printk("Audit %d: [hl2mfn=%lx,i=%x] Skip foreign page "
+                               "dom=%p (id=%d) mfn=%lx c=%08x t=%08x\n",
                                d->id, hl2mfn, i,
                                page_get_owner(gpage),
                                page_get_owner(gpage)->id,
@@ -269,8 +273,8 @@ int audit_adjust_pgtables(struct domain *d, int dir, int noisy)
                         if ( !((gpage->u.inuse.type_info & PGT_type_mask) ==
                                PGT_writable_page) )
                         {
-                            printk("Audit %d: [l1mfn=%p, i=%x] Illegal RW "
-                                   "t=%x mfn=%p\n",
+                            printk("Audit %d: [l1mfn=%lx, i=%x] Illegal RW "
+                                   "t=%x mfn=%lx\n",
                                    d->id, l1mfn, i,
                                    gpage->u.inuse.type_info, gmfn);
                             errors++;
@@ -280,8 +284,8 @@ int audit_adjust_pgtables(struct domain *d, int dir, int noisy)
                              page_is_page_table(gpage) &&
                              ! page_out_of_sync(gpage) )
                         {
-                            printk("Audit %d: [l1mfn=%p, i=%x] Illegal RW of "
-                                   "page table gmfn=%p\n",
+                            printk("Audit %d: [l1mfn=%lx, i=%x] Illegal RW of "
+                                   "page table gmfn=%lx\n",
                                    d->id, l1mfn, i, gmfn);
                             errors++;
                         }
@@ -289,8 +293,8 @@ int audit_adjust_pgtables(struct domain *d, int dir, int noisy)
 
                     if ( page_get_owner(gpage) != d )
                     {
-                        printk("Audit %d: [l1mfn=%p,i=%x] Skip foreign page "
-                               "dom=%p (id=%d) mfn=%p c=%08x t=%08x\n",
+                        printk("Audit %d: [l1mfn=%lx,i=%x] Skip foreign page "
+                               "dom=%p (id=%d) mfn=%lx c=%08x t=%08x\n",
                                d->id, l1mfn, i,
                                page_get_owner(gpage),
                                page_get_owner(gpage)->id,
@@ -436,22 +440,23 @@ int audit_adjust_pgtables(struct domain *d, int dir, int noisy)
                     if ( shadow_enabled )
                     {
                         printk("Audit %d: found an L2 guest page "
-                               "mfn=%p t=%08x c=%08x while in shadow mode\n",
-                               mfn, page->u.inuse.type_info, page->count_info);
+                               "mfn=%lx t=%08x c=%08x while in shadow mode\n",
+                               d->id, mfn, page->u.inuse.type_info,
+                               page->count_info);
                         errors++;
                     }
 
                     if ( (page->u.inuse.type_info & PGT_validated) !=
                          PGT_validated )
                     {
-                        printk("Audit %d: L2 mfn=%p not validated %p\n",
+                        printk("Audit %d: L2 mfn=%lx not validated %08x\n",
                                d->id, mfn, page->u.inuse.type_info);
                         errors++;
                     }
 
                     if ( (page->u.inuse.type_info & PGT_pinned) != PGT_pinned )
                     {
-                        printk("Audit %d: L2 mfn=%p not pinned t=%p\n",
+                        printk("Audit %d: L2 mfn=%lx not pinned t=%08x\n",
                                d->id, mfn, page->u.inuse.type_info);
                         errors++;
                     }
@@ -472,14 +477,15 @@ int audit_adjust_pgtables(struct domain *d, int dir, int noisy)
                 {
                     if ( shadow_enabled )
                     {
-                        printk("found an L1 guest page mfn=%p t=%08x c=%08x while in shadow mode\n",
+                        printk("found an L1 guest page mfn=%lx t=%08x c=%08x "
+                               "while in shadow mode\n",
                                mfn, page->u.inuse.type_info, page->count_info);
                         errors++;
                     }
 
                     if ( (page->u.inuse.type_info & PGT_validated) != PGT_validated )
                     {
-                        printk("Audit %d: L1 not validated mfn=%p t=%p\n",
+                        printk("Audit %d: L1 not validated mfn=%lx t=%08x\n",
                                d->id, mfn, page->u.inuse.type_info);
                         errors++;
                     }
@@ -488,7 +494,7 @@ int audit_adjust_pgtables(struct domain *d, int dir, int noisy)
                     {
                         if ( !VM_ASSIST(d, VMASST_TYPE_writable_pagetables) )
                         {
-                            printk("Audit %d: L1 mfn=%p not pinned t=%p\n",
+                            printk("Audit %d: L1 mfn=%lx not pinned t=%08x\n",
                                    d->id, mfn, page->u.inuse.type_info);
                             errors++;
                         }
@@ -575,7 +581,7 @@ void audit_pagelist(struct domain *d)
     if ( xenpages != d->xenheap_pages ||
          totpages != d->tot_pages )
     {
-        printk("ARGH! dom %d: xen=%d %d, pages=%d %d\n",
+        printk("ARGH! dom %d: xen=%d %d, pages=%d %d\n", d->id,
                xenpages, d->xenheap_pages, 
                totpages, d->tot_pages );
     }
@@ -593,7 +599,8 @@ void _audit_domain(struct domain *d, int flags)
         for ( i = 0; i < L1_PAGETABLE_ENTRIES; i++ )
         {
             if ( (pt[i] & _PAGE_PRESENT) && ((pt[i] >> PAGE_SHIFT) == xmfn) )
-                printk("     found dom=%d mfn=%p t=%x c=%x pt[i=%x]=%p\n",
+                printk("     found dom=%d mfn=%lx t=%08x c=%08x "
+                       "pt[i=%x]=%lx\n",
                        d->id, mfn, page->u.inuse.type_info,
                        page->count_info, i, pt[i]);
         }
@@ -704,7 +711,7 @@ void _audit_domain(struct domain *d, int flags)
         if ( (page->u.inuse.type_info & PGT_count_mask) >
              (page->count_info & PGC_count_mask) )
         {
-            printk("taf(%08x) > caf(%08x) mfn=%p\n",
+            printk("taf(%08x) > caf(%08x) mfn=%lx\n",
                    page->u.inuse.type_info, page->count_info, mfn);
             errors++;
         }
@@ -713,7 +720,8 @@ void _audit_domain(struct domain *d, int flags)
              (page_type == PGT_writable_page) &&
              !(page->u.inuse.type_info & PGT_validated) )
         {
-            printk("shadow mode writable page not validated mfn=%p t=%08x c=%08x\n",
+            printk("shadow mode writable page not validated mfn=%lx "
+                   "t=%08x c=%08x\n",
                    mfn, page->u.inuse.type_info, page->count_info);
             errors++;
         }
@@ -722,7 +730,8 @@ void _audit_domain(struct domain *d, int flags)
         if ( page_type == PGT_writable_page && 
              (page->u.inuse.type_info & PGT_count_mask) > 1 )
         {
-            printk("writeable page with type count >1: mfn=%lx t=%x c=%x\n",
+            printk("writeable page with type count >1: "
+                   "mfn=%lx t=%08x c=%08x\n",
                   mfn,
                   page->u.inuse.type_info,
                   page->count_info );
@@ -734,7 +743,7 @@ void _audit_domain(struct domain *d, int flags)
         if ( page_type == PGT_none && 
              (page->u.inuse.type_info & PGT_count_mask) > 0 )
         {
-            printk("normal page with type count >0: mfn=%lx t=%x c=%x\n",
+            printk("normal page with type count >0: mfn=%lx t=%08x c=%08x\n",
                   mfn,
                   page->u.inuse.type_info,
                   page->count_info );
@@ -745,18 +754,20 @@ void _audit_domain(struct domain *d, int flags)
         {
             if ( !page_is_page_table(page) )
             {
-                printk("out of sync page mfn=%p is not a page table\n", mfn);
+                printk("out of sync page mfn=%lx is not a page table\n", mfn);
                 errors++;
             }
             unsigned long pfn = __mfn_to_gpfn(d, mfn);
             if ( !__shadow_status(d, pfn, PGT_snapshot) )
             {
-                printk("out of sync page mfn=%p doesn't have a snapshot\n");
+                printk("out of sync page mfn=%lx doesn't have a snapshot\n",
+                       mfn);
                 errors++;
             }
             if ( page_type != PGT_writable_page )
             {
-                printk("out of sync page mfn=%p has strange type t=%08x c=%08x\n",
+                printk("out of sync page mfn=%lx has strange type "
+                       "t=%08x c=%08x\n",
                        mfn, page->u.inuse.type_info, page->count_info);
                 errors++;
             }
@@ -854,7 +865,8 @@ void _audit_domain(struct domain *d, int flags)
                     if ( ((page->u.inuse.type_info & PGT_type_mask) != page_type ) ||
                          (page->count_info != 0) )
                     {
-                        printk("Audit %d: shadow page counts wrong mfn=%p t=%x c=%x\n",
+                        printk("Audit %d: shadow page counts wrong "
+                               "mfn=%lx t=%08x c=%08x\n",
                                d->id, page_to_pfn(page),
                                page->u.inuse.type_info,
                                page->count_info);
index 1b4f0ca445df2ac6012070d3568a1f50f265f872..a5029a45d5fe684b98c69e4c338c667a30742929 100644 (file)
@@ -180,23 +180,23 @@ void dump_pageframe_info(struct domain *d)
     {
         list_for_each_entry ( page, &d->page_list, list )
         {
-            printk("Page %08x: caf=%08x, taf=%08x\n",
-                   page_to_phys(page), page->count_info,
+            printk("Page %p: caf=%08x, taf=%08x\n",
+                   _p(page_to_phys(page)), page->count_info,
                    page->u.inuse.type_info);
         }
     }
 
     list_for_each_entry ( page, &d->xenpage_list, list )
     {
-        printk("XenPage %08x: caf=%08x, taf=%08x\n",
-               page_to_phys(page), page->count_info,
+        printk("XenPage %p: caf=%08x, taf=%08x\n",
+               _p(page_to_phys(page)), page->count_info,
                page->u.inuse.type_info);
     }
 
     
     page = virt_to_page(d->shared_info);
-    printk("Shared_info@%08x: caf=%08x, taf=%08x\n",
-           page_to_phys(page), page->count_info,
+    printk("Shared_info@%p: caf=%08x, taf=%08x\n",
+           _p(page_to_phys(page)), page->count_info,
            page->u.inuse.type_info);
 }
 
index 0b058018acd7a3eec6f1326bbb4398e5e68be78f..f1488d6f081fa7638fe1e8c9fb92d76900122639 100644 (file)
@@ -184,9 +184,9 @@ int construct_dom0(struct domain *d,
 
     printk("PHYSICAL MEMORY ARRANGEMENT:\n"
            " Dom0 alloc.:   %p->%p",
-           alloc_start, alloc_end);
+           _p(alloc_start), _p(alloc_end));
     if ( d->tot_pages < nr_pages )
-        printk(" (%d pages to be allocated)",
+        printk(" (%lu pages to be allocated)",
                nr_pages - d->tot_pages);
     printk("\nVIRTUAL MEMORY ARRANGEMENT:\n"
            " Loaded kernel: %p->%p\n"
@@ -196,14 +196,14 @@ int construct_dom0(struct domain *d,
            " Start info:    %p->%p\n"
            " Boot stack:    %p->%p\n"
            " TOTAL:         %p->%p\n",
-           dsi.v_kernstart, dsi.v_kernend
-           vinitrd_start, vinitrd_end,
-           vphysmap_start, vphysmap_end,
-           vpt_start, vpt_end,
-           vstartinfo_start, vstartinfo_end,
-           vstack_start, vstack_end,
-           dsi.v_start, v_end);
-    printk(" ENTRY ADDRESS: %p\n", dsi.v_kernentry);
+           _p(dsi.v_kernstart), _p(dsi.v_kernend)
+           _p(vinitrd_start), _p(vinitrd_end),
+           _p(vphysmap_start), _p(vphysmap_end),
+           _p(vpt_start), _p(vpt_end),
+           _p(vstartinfo_start), _p(vstartinfo_end),
+           _p(vstack_start), _p(vstack_end),
+           _p(dsi.v_start), _p(v_end));
+    printk(" ENTRY ADDRESS: %p\n", _p(dsi.v_kernentry));
 
     if ( (v_end - dsi.v_start) > (nr_pages * PAGE_SIZE) )
     {
@@ -508,7 +508,7 @@ int construct_dom0(struct domain *d,
     {
         si->mod_start = vinitrd_start;
         si->mod_len   = initrd_len;
-        printk("Initrd len 0x%lx, start at 0x%p\n",
+        printk("Initrd len 0x%lx, start at 0x%lx\n",
                si->mod_len, si->mod_start);
     }
 
index f97e50f4904c94fb5e9042656d144fcd018a3c54..30c8d8b9bb516910c06f57e70347bb2bb635319f 100644 (file)
@@ -40,8 +40,8 @@ print_e820_memory_map(struct e820entry *map, int entries)
 
     for (i = 0; i < entries; i++) {
         printk(" %016Lx - %016Lx ",
-               map[i].addr,
-               map[i].addr + map[i].size);
+               (unsigned long long)(map[i].addr),
+               (unsigned long long)(map[i].addr + map[i].size));
         switch (map[i].type) {
         case E820_RAM: printk("(usable)\n");
             break;
index 3aaeb4a2b25ba406c966c9bc87ca3b110075cd35..c986b74d7cb47637de5ed2a3ac3e188e359123ef 100644 (file)
@@ -73,7 +73,7 @@ search_pre_exception_table(struct xen_regs *regs)
     unsigned long addr = (unsigned long)regs->eip;
     unsigned long fixup = search_one_table(
         __start___pre_ex_table, __stop___pre_ex_table-1, addr);
-    DPRINTK("Pre-exception: %p -> %p\n", addr, fixup);
+    DPRINTK("Pre-exception: %p -> %p\n", _p(addr), _p(fixup));
 #ifdef PERF_COUNTERS
     if ( fixup )
         perfc_incrc(exception_fixed);
index 82b3ab1fcd6bc9c28674efd27f2da4b9139d39d6..e4f989ad5e65c63d98821ad5bbe929f6a8f87f17 100644 (file)
@@ -342,7 +342,7 @@ static int get_page_from_pagenr(unsigned long page_nr, struct domain *d)
 
     if ( unlikely(!pfn_valid(page_nr)) || unlikely(!get_page(page, d)) )
     {
-        MEM_LOG("Could not get page ref for pfn %p", page_nr);
+        MEM_LOG("Could not get page ref for pfn %lx", page_nr);
         return 0;
     }
 
@@ -362,7 +362,7 @@ static int get_page_and_type_from_pagenr(unsigned long page_nr,
     if ( unlikely(!get_page_type(page, type)) )
     {
         if ( (type & PGT_type_mask) != PGT_l1_page_table )
-            MEM_LOG("Bad page type for pfn %p (%08x)", 
+            MEM_LOG("Bad page type for pfn %lx (%08x)", 
                     page_nr, page->u.inuse.type_info);
         put_page(page);
         return 0;
@@ -442,7 +442,7 @@ get_page_from_l1e(
 
     if ( unlikely(l1e_get_flags(l1e) & L1_DISALLOW_MASK) )
     {
-        MEM_LOG("Bad L1 type settings %p %p", l1e_get_value(l1e),
+        MEM_LOG("Bad L1 type settings %lx %lx", l1e_get_value(l1e),
                 l1e_get_value(l1e) & L1_DISALLOW_MASK);
         return 0;
     }
@@ -489,7 +489,7 @@ get_page_from_l2e(
 
     if ( unlikely((l2e_get_flags(l2e) & L2_DISALLOW_MASK)) )
     {
-        MEM_LOG("Bad L2 page type settings %p",
+        MEM_LOG("Bad L2 page type settings %lx",
                 l2e_get_value(l2e) & L2_DISALLOW_MASK);
         return 0;
     }
@@ -517,7 +517,7 @@ get_page_from_l3e(
 
     if ( unlikely((l3e_get_flags(l3e) & L3_DISALLOW_MASK)) )
     {
-        MEM_LOG("Bad L3 page type settings %p",
+        MEM_LOG("Bad L3 page type settings %lx",
                 l3e_get_value(l3e) & L3_DISALLOW_MASK);
         return 0;
     }
@@ -538,7 +538,7 @@ get_page_from_l4e(
 
     if ( unlikely((l4e_get_flags(l4e) & L4_DISALLOW_MASK)) )
     {
-        MEM_LOG("Bad L4 page type settings %p",
+        MEM_LOG("Bad L4 page type settings %lx",
                 l4e_get_value(l4e) & L4_DISALLOW_MASK);
         return 0;
     }
@@ -846,7 +846,7 @@ static inline int update_l1e(l1_pgentry_t *pl1e,
     if ( unlikely(cmpxchg_user(pl1e, o, n) != 0) ||
          unlikely(o != l1e_get_value(ol1e)) )
     {
-        MEM_LOG("Failed to update %p -> %p: saw %p",
+        MEM_LOG("Failed to update %lx -> %lx: saw %lx",
                 l1e_get_value(ol1e), l1e_get_value(nl1e), o);
         return 0;
     }
@@ -870,7 +870,7 @@ static int mod_l1_entry(l1_pgentry_t *pl1e, l1_pgentry_t nl1e)
     {
         if ( unlikely(l1e_get_flags(nl1e) & L1_DISALLOW_MASK) )
         {
-            MEM_LOG("Bad L1 type settings %p", 
+            MEM_LOG("Bad L1 type settings %lx", 
                     l1e_get_value(nl1e) & L1_DISALLOW_MASK);
             return 0;
         }
@@ -904,7 +904,7 @@ static int mod_l1_entry(l1_pgentry_t *pl1e, l1_pgentry_t nl1e)
                                 _t ## e_get_value(_o),                  \
                                 _t ## e_get_value(_n));                 \
     if ( __o != _t ## e_get_value(_o) )                                 \
-        MEM_LOG("Failed to update %p -> %p: saw %p",                    \
+        MEM_LOG("Failed to update %lx -> %lx: saw %lx",                 \
                 _t ## e_get_value(_o), _t ## e_get_value(_n), __o);     \
     (__o == _t ## e_get_value(_o)); })
 
@@ -929,7 +929,7 @@ static int mod_l2_entry(l2_pgentry_t *pl2e,
     {
         if ( unlikely(l2e_get_flags(nl2e) & L2_DISALLOW_MASK) )
         {
-            MEM_LOG("Bad L2 type settings %p", 
+            MEM_LOG("Bad L2 type settings %lx", 
                     l2e_get_value(nl2e) & L2_DISALLOW_MASK);
             return 0;
         }
@@ -982,7 +982,7 @@ static int mod_l3_entry(l3_pgentry_t *pl3e,
     {
         if ( unlikely(l3e_get_flags(nl3e) & L3_DISALLOW_MASK) )
         {
-            MEM_LOG("Bad L3 type settings %p", 
+            MEM_LOG("Bad L3 type settings %lx", 
                     l3e_get_value(nl3e) & L3_DISALLOW_MASK);
             return 0;
         }
@@ -1032,7 +1032,7 @@ static int mod_l4_entry(l4_pgentry_t *pl4e,
     {
         if ( unlikely(l4e_get_flags(nl4e) & L4_DISALLOW_MASK) )
         {
-            MEM_LOG("Bad L4 type settings %p", 
+            MEM_LOG("Bad L4 type settings %lx", 
                     l4e_get_value(nl4e) & L4_DISALLOW_MASK);
             return 0;
         }
@@ -1189,7 +1189,7 @@ int get_page_type(struct pfn_info *page, u32 type)
         nx = x + 1;
         if ( unlikely((nx & PGT_count_mask) == 0) )
         {
-            MEM_LOG("Type count overflow on pfn %p", page_to_pfn(page));
+            MEM_LOG("Type count overflow on pfn %lx", page_to_pfn(page));
             return 0;
         }
         else if ( unlikely((x & PGT_count_mask) == 0) )
@@ -1228,7 +1228,7 @@ int get_page_type(struct pfn_info *page, u32 type)
                 {
                     if ( ((x & PGT_type_mask) != PGT_l2_page_table) ||
                          ((type & PGT_type_mask) != PGT_l1_page_table) )
-                        MEM_LOG("Bad type (saw %08x != exp %08x) for pfn %p",
+                        MEM_LOG("Bad type (saw %08x != exp %08x) for pfn %lx",
                                 x, type, page_to_pfn(page));
                     return 0;
                 }
@@ -1241,7 +1241,7 @@ int get_page_type(struct pfn_info *page, u32 type)
                 else if ( ((type & PGT_va_mask) != PGT_va_mutable) &&
                           ((type & PGT_va_mask) != (x & PGT_va_mask)) )
                 {
-                    /* This table is potentially mapped at multiple locations. */
+                    /* This table is may be mapped at multiple locations. */
                     nx &= ~PGT_va_mask;
                     nx |= PGT_va_unknown;
                 }
@@ -1262,7 +1262,7 @@ int get_page_type(struct pfn_info *page, u32 type)
         /* Try to validate page type; drop the new reference on failure. */
         if ( unlikely(!alloc_page_type(page, type & PGT_type_mask)) )
         {
-            MEM_LOG("Error while validating pfn %p for type %08x."
+            MEM_LOG("Error while validating pfn %lx for type %08x."
                     " caf=%08x taf=%08x",
                     page_to_pfn(page), type,
                     page->count_info,
@@ -1307,21 +1307,20 @@ int new_guest_cr3(unsigned long mfn)
         else
             put_page_and_type(&frame_table[old_base_mfn]);
 
-        // CR3 holds its own ref to its shadow...
-        //
+        /* CR3 holds its own ref to its shadow. */
         if ( shadow_mode_enabled(d) )
         {
             if ( ed->arch.monitor_shadow_ref )
                 put_shadow_ref(ed->arch.monitor_shadow_ref);
             ed->arch.monitor_shadow_ref =
                 pagetable_val(ed->arch.monitor_table) >> PAGE_SHIFT;
-            ASSERT(page_get_owner(&frame_table[ed->arch.monitor_shadow_ref]) == NULL);
+            ASSERT(!page_get_owner(&frame_table[ed->arch.monitor_shadow_ref]));
             get_shadow_ref(ed->arch.monitor_shadow_ref);
         }
     }
     else
     {
-        MEM_LOG("Error while installing new baseptr %p", mfn);
+        MEM_LOG("Error while installing new baseptr %lx", mfn);
     }
 
     return okay;
@@ -1493,14 +1492,14 @@ int do_mmuext_op(
             okay = get_page_and_type_from_pagenr(op.mfn, type, FOREIGNDOM);
             if ( unlikely(!okay) )
             {
-                MEM_LOG("Error while pinning MFN %p", op.mfn);
+                MEM_LOG("Error while pinning mfn %lx", op.mfn);
                 break;
             }
             
             if ( unlikely(test_and_set_bit(_PGT_pinned,
                                            &page->u.inuse.type_info)) )
             {
-                MEM_LOG("MFN %p already pinned", op.mfn);
+                MEM_LOG("Mfn %lx already pinned", op.mfn);
                 put_page_and_type(page);
                 okay = 0;
                 break;
@@ -1525,7 +1524,7 @@ int do_mmuext_op(
         case MMUEXT_UNPIN_TABLE:
             if ( unlikely(!(okay = get_page_from_pagenr(op.mfn, FOREIGNDOM))) )
             {
-                MEM_LOG("MFN %p bad domain (dom=%p)",
+                MEM_LOG("Mfn %lx bad domain (dom=%p)",
                         op.mfn, page_get_owner(page));
             }
             else if ( likely(test_and_clear_bit(_PGT_pinned, 
@@ -1538,7 +1537,7 @@ int do_mmuext_op(
             {
                 okay = 0;
                 put_page(page);
-                MEM_LOG("MFN %p not pinned", op.mfn);
+                MEM_LOG("Mfn %lx not pinned", op.mfn);
             }
             break;
 
@@ -1553,7 +1552,7 @@ int do_mmuext_op(
                 op.mfn, PGT_root_page_table, d);
             if ( unlikely(!okay) )
             {
-                MEM_LOG("Error while installing new MFN %p", op.mfn);
+                MEM_LOG("Error while installing new mfn %lx", op.mfn);
             }
             else
             {
@@ -1638,7 +1637,7 @@ int do_mmuext_op(
                  !array_access_ok(ptr, ents, LDT_ENTRY_SIZE) )
             {
                 okay = 0;
-                MEM_LOG("Bad args to SET_LDT: ptr=%p, ents=%p", ptr, ents);
+                MEM_LOG("Bad args to SET_LDT: ptr=%lx, ents=%lx", ptr, ents);
             }
             else if ( (ed->arch.ldt_ents != ents) || 
                       (ed->arch.ldt_base != ptr) )
@@ -1665,7 +1664,7 @@ int do_mmuext_op(
             e = percpu_info[cpu].foreign;
             if ( unlikely(e == NULL) )
             {
-                MEM_LOG("No FOREIGNDOM to reassign MFN %p to", op.mfn);
+                MEM_LOG("No FOREIGNDOM to reassign mfn %lx to", op.mfn);
                 okay = 0;
                 break;
             }
@@ -1697,7 +1696,7 @@ int do_mmuext_op(
                  unlikely(IS_XEN_HEAP_FRAME(page)) )
             {
                 MEM_LOG("Transferee has no reservation headroom (%d,%d), or "
-                        "page is in Xen heap (%p), or dom is dying (%d).\n",
+                        "page is in Xen heap (%lx), or dom is dying (%ld).\n",
                         e->tot_pages, e->max_pages, op.mfn, e->d_flags);
                 okay = 0;
                 goto reassign_fail;
@@ -1717,7 +1716,7 @@ int do_mmuext_op(
                               (1|PGC_allocated)) ||
                      unlikely(_nd != _d) )
                 {
-                    MEM_LOG("Bad page values %p: ed=%p(%u), sd=%p,"
+                    MEM_LOG("Bad page values %lx: ed=%p(%u), sd=%p,"
                             " caf=%08x, taf=%08x\n", page_to_pfn(page),
                             d, d->id, unpickle_domptr(_nd), x,
                             page->u.inuse.type_info);
@@ -1754,7 +1753,7 @@ int do_mmuext_op(
             break;
             
         default:
-            MEM_LOG("Invalid extended pt command 0x%p", op.cmd);
+            MEM_LOG("Invalid extended pt command 0x%x", op.cmd);
             okay = 0;
             break;
         }
@@ -1959,12 +1958,12 @@ int do_mmu_update(
 
         case MMU_MACHPHYS_UPDATE:
 
-            // HACK ALERT...  Need to think about this some more...
-            //
+            /* HACK ALERT...  Need to think about this some more... */
             if ( unlikely(shadow_mode_translate(FOREIGNDOM) && IS_PRIV(d)) )
             {
                 rc = FOREIGNDOM->next_io_page++;
-                printk("privileged guest dom%d requests mfn=%p for dom%d, gets pfn=%p\n",
+                printk("privileged guest dom%d requests mfn=%lx for dom%d, "
+                       "gets pfn=%x\n",
                        d->id, mfn, FOREIGNDOM->id, rc);
                 set_machinetophys(mfn, rc);
                 set_p2m_entry(FOREIGNDOM, rc, mfn);
@@ -1999,7 +1998,7 @@ int do_mmu_update(
             break;
 
         default:
-            MEM_LOG("Invalid page update command %p", req.ptr);
+            MEM_LOG("Invalid page update command %lx", req.ptr);
             break;
         }
 
@@ -2497,7 +2496,7 @@ void ptwr_flush(struct domain *d, const int which)
          */
         BUG();
     }
-    PTWR_PRINTK("[%c] disconnected_l1va at %p is %p\n",
+    PTWR_PRINTK("[%c] disconnected_l1va at %p is %lx\n",
                 PTWR_PRINT_WHICH, ptep, pte);
     pte &= ~_PAGE_RW;
 
@@ -2515,7 +2514,7 @@ void ptwr_flush(struct domain *d, const int which)
     /* Ensure that there are no stale writable mappings in any TLB. */
     /* NB. INVLPG is a serialising instruction: flushes pending updates. */
     local_flush_tlb_one(l1va); /* XXX Multi-CPU guests? */
-    PTWR_PRINTK("[%c] disconnected_l1va at %p now %p\n",
+    PTWR_PRINTK("[%c] disconnected_l1va at %p now %lx\n",
                 PTWR_PRINT_WHICH, ptep, pte);
 
     /*
@@ -2597,7 +2596,7 @@ static int ptwr_emulated_update(
     /* Aligned access only, thank you. */
     if ( !access_ok(addr, bytes) || ((addr & (bytes-1)) != 0) )
     {
-        MEM_LOG("ptwr_emulate: Unaligned or bad size ptwr access (%d, %p)\n",
+        MEM_LOG("ptwr_emulate: Unaligned or bad size ptwr access (%d, %lx)\n",
                 bytes, addr);
         return X86EMUL_UNHANDLEABLE;
     }
@@ -2633,12 +2632,12 @@ static int ptwr_emulated_update(
     page = &frame_table[pfn];
 
     /* We are looking only for read-only mappings of p.t. pages. */
-    if ( ((l1e_get_flags(pte) & (_PAGE_RW | _PAGE_PRESENT)) != _PAGE_PRESENT) ||
+    if ( ((l1e_get_flags(pte) & (_PAGE_RW|_PAGE_PRESENT)) != _PAGE_PRESENT) ||
          ((page->u.inuse.type_info & PGT_type_mask) != PGT_l1_page_table) ||
          (page_get_owner(page) != d) )
     {
-        MEM_LOG("ptwr_emulate: Page is mistyped or bad pte (%p, %x)\n",
-                pte, page->u.inuse.type_info);
+        MEM_LOG("ptwr_emulate: Page is mistyped or bad pte (%lx, %08x)\n",
+                l1e_get_pfn(pte), page->u.inuse.type_info);
         return X86EMUL_UNHANDLEABLE;
     }
 
@@ -2787,8 +2786,8 @@ int ptwr_do_page_fault(struct domain *d, unsigned long addr)
             which = PTWR_PT_ACTIVE;
     }
     
-    PTWR_PRINTK("[%c] page_fault on l1 pt at va %p, pt for %08x, "
-                "pfn %p\n", PTWR_PRINT_WHICH,
+    PTWR_PRINTK("[%c] page_fault on l1 pt at va %lx, pt for %08x, "
+                "pfn %lx\n", PTWR_PRINT_WHICH,
                 addr, l2_idx << L2_PAGETABLE_SHIFT, pfn);
     
     /*
@@ -2823,8 +2822,6 @@ int ptwr_do_page_fault(struct domain *d, unsigned long addr)
     
     /* Finally, make the p.t. page writable by the guest OS. */
     l1e_add_flags(&pte, _PAGE_RW);
-    PTWR_PRINTK("[%c] update %p pte to %p\n", PTWR_PRINT_WHICH,
-                &linear_pg_table[addr>>PAGE_SHIFT], pte);
     if ( unlikely(__copy_to_user(&linear_pg_table[addr>>PAGE_SHIFT],
                                  &pte, sizeof(pte))) )
     {
index 80b4c0954888b20753617ba7c3d746b3c09cedbf..1db8ed71e9b57580e52a2f70eb85317d4b9c3860 100644 (file)
@@ -65,11 +65,11 @@ shadow_promote(struct domain *d, unsigned long gpfn, unsigned long gmfn,
     if ( unlikely(page_is_page_table(page)) )
         return 1;
 
-    FSH_LOG("%s: gpfn=%p gmfn=%p nt=%p", __func__, gpfn, gmfn, new_type);
+    FSH_LOG("%s: gpfn=%lx gmfn=%lx nt=%08lx", __func__, gpfn, gmfn, new_type);
 
     if ( !shadow_remove_all_write_access(d, gpfn, gmfn) )
     {
-        FSH_LOG("%s: couldn't find/remove all write accesses, gpfn=%p gmfn=%p",
+        FSH_LOG("%s: couldn't find/remove all write accesses, gpfn=%lx gmfn=%lx",
                 __func__, gpfn, gmfn);
 #if 1 || defined(LIVE_DANGEROUSLY)
         set_bit(_PGC_page_table, &page->count_info);
@@ -107,7 +107,7 @@ shadow_promote(struct domain *d, unsigned long gpfn, unsigned long gmfn,
     else
     {
         printk("shadow_promote: get_page_type failed "
-               "dom%d gpfn=%p gmfn=%p t=%x\n",
+               "dom%d gpfn=%lx gmfn=%lx t=%08lx\n",
                d->id, gpfn, gmfn, new_type);
         okay = 0;
     }
@@ -294,7 +294,7 @@ alloc_shadow_page(struct domain *d,
     return smfn;
 
   fail:
-    FSH_LOG("promotion of pfn=%p mfn=%p failed!  external gnttab refs?",
+    FSH_LOG("promotion of pfn=%lx mfn=%lx failed!  external gnttab refs?",
             gpfn, gmfn);
     free_domheap_page(page);
     return 0;
@@ -325,7 +325,7 @@ free_shadow_hl2_table(struct domain *d, unsigned long smfn)
     l1_pgentry_t *hl2 = map_domain_mem(smfn << PAGE_SHIFT);
     int i, limit;
 
-    SH_VVLOG("%s: smfn=%p freed", __func__, smfn);
+    SH_VVLOG("%s: smfn=%lx freed", __func__, smfn);
 
 #ifdef __i386__
     if ( shadow_mode_external(d) )
@@ -376,7 +376,7 @@ void free_shadow_page(unsigned long smfn)
     unsigned long gpfn = __mfn_to_gpfn(d, gmfn);
     unsigned long type = page->u.inuse.type_info & PGT_type_mask;
 
-    SH_VVLOG("%s: free'ing smfn=%p", __func__, smfn);
+    SH_VVLOG("%s: free'ing smfn=%lx", __func__, smfn);
 
     ASSERT( ! IS_INVALID_M2P_ENTRY(gpfn) );
 
@@ -407,8 +407,8 @@ void free_shadow_page(unsigned long smfn)
         break;
 
     default:
-        printk("Free shadow weird page type mfn=%08x type=%08x\n",
-               page-frame_table, page->u.inuse.type_info);
+        printk("Free shadow weird page type mfn=%lx type=%08x\n",
+               page_to_pfn(page), page->u.inuse.type_info);
         break;
     }
 
@@ -1132,8 +1132,8 @@ void __shadow_mode_disable(struct domain *d)
     {
         if ( d->arch.shadow_ht[i].gpfn_and_flags != 0 )
         {
-            printk("%s: d->arch.shadow_ht[%x].gpfn_and_flags=%p\n",
-                   i, d->arch.shadow_ht[i].gpfn_and_flags);
+            printk("%s: d->arch.shadow_ht[%x].gpfn_and_flags=%lx\n",
+                   __FILE__, i, d->arch.shadow_ht[i].gpfn_and_flags);
             BUG();
         }
     }
@@ -1154,7 +1154,7 @@ static int shadow_mode_table_op(
 
     ASSERT(spin_is_locked(&d->arch.shadow_lock));
 
-    SH_VLOG("shadow mode table op %p %p count %d",
+    SH_VLOG("shadow mode table op %lx %lx count %d",
             pagetable_val(d->exec_domain[0]->arch.guest_table),  /* XXX SMP */
             pagetable_val(d->exec_domain[0]->arch.shadow_table), /* XXX SMP */
             d->arch.shadow_page_count);
@@ -1342,7 +1342,7 @@ gpfn_to_mfn_foreign(struct domain *d, unsigned long gpfn)
     unmap_domain_mem(l2);
     if ( !(l2e_get_flags(l2e) & _PAGE_PRESENT) )
     {
-        printk("gpfn_to_mfn_foreign(d->id=%d, gpfn=%p) => 0 l2e=%p\n",
+        printk("gpfn_to_mfn_foreign(d->id=%d, gpfn=%lx) => 0 l2e=%lx\n",
                d->id, gpfn, l2e_get_value(l2e));
         return INVALID_MFN;
     }
@@ -1352,13 +1352,13 @@ gpfn_to_mfn_foreign(struct domain *d, unsigned long gpfn)
     unmap_domain_mem(l1);
 
 #if 0
-    printk("gpfn_to_mfn_foreign(d->id=%d, gpfn=%p) => %p phystab=%p l2e=%p l1tab=%p, l1e=%p\n",
+    printk("gpfn_to_mfn_foreign(d->id=%d, gpfn=%lx) => %lx phystab=%lx l2e=%lx l1tab=%lx, l1e=%lx\n",
            d->id, gpfn, l1_pgentry_val(l1e) >> PAGE_SHIFT, phystab, l2e, l1tab, l1e);
 #endif
 
     if ( !(l1e_get_flags(l1e) & _PAGE_PRESENT) )
     {
-        printk("gpfn_to_mfn_foreign(d->id=%d, gpfn=%p) => 0 l1e=%p\n",
+        printk("gpfn_to_mfn_foreign(d->id=%d, gpfn=%lx) => 0 l1e=%lx\n",
                d->id, gpfn, l1e_get_value(l1e));
         return INVALID_MFN;
     }
@@ -1378,11 +1378,12 @@ shadow_hl2_table(struct domain *d, unsigned long gpfn, unsigned long gmfn,
 
     if ( unlikely(!(hl2mfn = alloc_shadow_page(d, gpfn, gmfn, PGT_hl2_shadow))) )
     {
-        printk("Couldn't alloc an HL2 shadow for pfn=%p mfn=%p\n", gpfn, gmfn);
+        printk("Couldn't alloc an HL2 shadow for pfn=%lx mfn=%lx\n",
+               gpfn, gmfn);
         BUG(); /* XXX Deal gracefully with failure. */
     }
 
-    SH_VVLOG("shadow_hl2_table(gpfn=%p, gmfn=%p, smfn=%p) => %p",
+    SH_VVLOG("shadow_hl2_table(gpfn=%lx, gmfn=%lx, smfn=%lx) => %lx",
              gpfn, gmfn, smfn, hl2mfn);
     perfc_incrc(shadow_hl2_table_count);
 
@@ -1430,13 +1431,14 @@ static unsigned long shadow_l2_table(
     unsigned long smfn;
     l2_pgentry_t *spl2e;
 
-    SH_VVLOG("shadow_l2_table(gpfn=%p, gmfn=%p)", gpfn, gmfn);
+    SH_VVLOG("shadow_l2_table(gpfn=%lx, gmfn=%lx)", gpfn, gmfn);
 
     perfc_incrc(shadow_l2_table_count);
 
     if ( unlikely(!(smfn = alloc_shadow_page(d, gpfn, gmfn, PGT_l2_shadow))) )
     {
-        printk("Couldn't alloc an L2 shadow for pfn=%p mfn=%p\n", gpfn, gmfn);
+        printk("Couldn't alloc an L2 shadow for pfn=%lx mfn=%lx\n",
+               gpfn, gmfn);
         BUG(); /* XXX Deal gracefully with failure. */
     }
 
@@ -1497,7 +1499,7 @@ static unsigned long shadow_l2_table(
 
     unmap_domain_mem(spl2e);
 
-    SH_VLOG("shadow_l2_table(%p -> %p)", gmfn, smfn);
+    SH_VLOG("shadow_l2_table(%lx -> %lx)", gmfn, smfn);
     return smfn;
 }
 
@@ -1530,7 +1532,7 @@ void shadow_map_l1_into_current_l2(unsigned long va)
         if ( unlikely(!(sl1mfn =
                         alloc_shadow_page(d, gl1pfn, gl1mfn, PGT_l1_shadow))) )
         {
-            printk("Couldn't alloc an L1 shadow for pfn=%p mfn=%p\n",
+            printk("Couldn't alloc an L1 shadow for pfn=%lx mfn=%lx\n",
                    gl1pfn, gl1mfn);
             BUG(); /* XXX Need to deal gracefully with failure. */
         }
@@ -1541,7 +1543,7 @@ void shadow_map_l1_into_current_l2(unsigned long va)
     else
     {
         /* This L1 is shadowed already, but the L2 entry is missing. */
-        SH_VVLOG("4b: was shadowed, l2 missing (%p)", sl1mfn);
+        SH_VVLOG("4b: was shadowed, l2 missing (%lx)", sl1mfn);
     }
 
 #ifndef NDEBUG
@@ -1684,7 +1686,7 @@ shadow_make_snapshot(
 
     if ( unlikely(!(smfn = alloc_shadow_page(d, gpfn, gmfn, PGT_snapshot))) )
     {
-        printk("Couldn't alloc fullshadow snapshot for pfn=%p mfn=%p!\n"
+        printk("Couldn't alloc fullshadow snapshot for pfn=%lx mfn=%lx!\n"
                "Dom%d snapshot_count_count=%d\n",
                gpfn, gmfn, d->id, d->arch.snapshot_page_count);
         BUG(); /* XXX FIXME: try a shadow flush to free up some memory. */
@@ -1748,7 +1750,7 @@ shadow_mark_mfn_out_of_sync(struct exec_domain *ed, unsigned long gpfn,
     ASSERT(pfn_valid(mfn));
     ASSERT((page->u.inuse.type_info & PGT_type_mask) == PGT_writable_page);
 
-    FSH_LOG("%s(gpfn=%p, mfn=%p) c=%p t=%p", __func__,
+    FSH_LOG("%s(gpfn=%lx, mfn=%lx) c=%08x t=%08x", __func__,
             gpfn, mfn, page->count_info, page->u.inuse.type_info);
 
     // XXX this will require some more thought...  Cross-domain sharing and
@@ -1808,7 +1810,7 @@ void shadow_mark_va_out_of_sync(
     if ( !get_shadow_ref(l2e_get_pfn(sl2e)) )
         BUG();
 
-    FSH_LOG("mark_out_of_sync(va=%p -> writable_pl1e=%p)",
+    FSH_LOG("mark_out_of_sync(va=%lx -> writable_pl1e=%lx)",
             va, entry->writable_pl1e);
 }
 
@@ -1905,7 +1907,7 @@ increase_writable_pte_prediction(struct domain *d, unsigned long gpfn, unsigned
 
     prediction = (prediction & PGT_mfn_mask) | score;
 
-    //printk("increase gpfn=%p pred=%p create=%d\n", gpfn, prediction, create);
+    //printk("increase gpfn=%lx pred=%lx create=%d\n", gpfn, prediction, create);
     set_shadow_status(d, GPFN_TO_GPTEPAGE(gpfn), 0, prediction, PGT_writable_pred);
 
     if ( create )
@@ -1924,7 +1926,7 @@ decrease_writable_pte_prediction(struct domain *d, unsigned long gpfn, unsigned
 
     prediction = (prediction & PGT_mfn_mask) | score;
 
-    //printk("decrease gpfn=%p pred=%p score=%p\n", gpfn, prediction, score);
+    //printk("decrease gpfn=%lx pred=%lx score=%lx\n", gpfn, prediction, score);
 
     if ( score )
         set_shadow_status(d, GPFN_TO_GPTEPAGE(gpfn), 0, prediction, PGT_writable_pred);
@@ -2003,7 +2005,7 @@ static u32 remove_all_write_access_in_ptpage(
             put_page_from_l1e(old, d);
 
 #if 0
-        printk("removed write access to pfn=%p mfn=%p in smfn=%p entry %x "
+        printk("removed write access to pfn=%lx mfn=%lx in smfn=%lx entry %x "
                "is_l1_shadow=%d\n",
                readonly_gpfn, readonly_gmfn, pt_mfn, i, is_l1_shadow);
 #endif
@@ -2211,7 +2213,7 @@ static int resync_all(struct domain *d, u32 stype)
         if ( !(smfn = __shadow_status(d, entry->gpfn, stype)) )
             continue;
 
-        FSH_LOG("resyncing t=%p gpfn=%p gmfn=%p smfn=%p snapshot_mfn=%p",
+        FSH_LOG("resyncing t=%08x gpfn=%lx gmfn=%lx smfn=%lx snapshot_mfn=%lx",
                 stype, entry->gpfn, entry->gmfn, smfn, entry->snapshot_mfn);
 
         // Compare guest's new contents to its snapshot, validating
@@ -2428,7 +2430,8 @@ int shadow_fault(unsigned long va, struct xen_regs *regs)
 
     spte = l1e_empty();
 
-    SH_VVLOG("shadow_fault( va=%p, code=%lu )", va, regs->error_code);
+    SH_VVLOG("shadow_fault( va=%lx, code=%lu )",
+             va, (unsigned long)regs->error_code);
     perfc_incrc(shadow_fault_calls);
     
     check_pagetable(ed, "pre-sf");
@@ -2463,7 +2466,8 @@ int shadow_fault(unsigned long va, struct xen_regs *regs)
     orig_gpte = gpte = linear_pg_table[l1_linear_offset(va)];
     if ( unlikely(!(l1e_get_flags(gpte) & _PAGE_PRESENT)) )
     {
-        SH_VVLOG("shadow_fault - EXIT: gpte not present (%lx)", gpte);
+        SH_VVLOG("shadow_fault - EXIT: gpte not present (%lx)",
+                 l1e_get_value(gpte));
         perfc_incrc(shadow_fault_bail_pte_not_present);
         goto fail;
     }
@@ -2474,7 +2478,8 @@ int shadow_fault(unsigned long va, struct xen_regs *regs)
         if ( unlikely(!(l1e_get_flags(gpte) & _PAGE_RW)) )
         {
             /* Write fault on a read-only mapping. */
-            SH_VVLOG("shadow_fault - EXIT: wr fault on RO page (%lx)", gpte);
+            SH_VVLOG("shadow_fault - EXIT: wr fault on RO page (%lx)", 
+                     l1e_get_value(gpte));
             perfc_incrc(shadow_fault_bail_ro_mapping);
             goto fail;
         }
@@ -2507,8 +2512,8 @@ int shadow_fault(unsigned long va, struct xen_regs *regs)
                                  &gpte, sizeof(gpte))) )
     {
         printk("shadow_fault() failed, crashing domain %d "
-               "due to a read-only L2 page table (gpde=%p), va=%p\n",
-               d->id, gpde, va);
+               "due to a read-only L2 page table (gpde=%lx), va=%lx\n",
+               d->id, l2e_get_value(gpde), va);
         domain_crash_synchronous();
     }
 
@@ -2595,7 +2600,7 @@ void __update_pagetables(struct exec_domain *ed)
     if ( old_smfn )
         put_shadow_ref(old_smfn);
 
-    SH_VVLOG("__update_pagetables(gmfn=%p, smfn=%p)", gmfn, smfn);
+    SH_VVLOG("__update_pagetables(gmfn=%lx, smfn=%lx)", gmfn, smfn);
 
     /*
      * arch.shadow_vtable
@@ -2685,9 +2690,9 @@ int shadow_status_noswap;
         printk("XXX %s-FAIL (%d,%d,%d)" _f " at %s(%d)\n",                   \
                sh_check_name, level, l2_idx, l1_idx, ## _a,                  \
                __FILE__, __LINE__);                                          \
-        printk("g=%08lx s=%08lx &g=%08lx &s=%08lx"                           \
-               " v2m(&g)=%08lx v2m(&s)=%08lx ea=%08lx\n",                    \
-               gpte, spte, pgpte, pspte,                                     \
+        printk("g=%lx s=%lx &g=%p &s=%p"                                     \
+               " v2m(&g)=%08lx v2m(&s)=%08lx ea=%08x\n",                     \
+               l1e_get_value(gpte), l1e_get_value(spte), pgpte, pspte,       \
                v2m(ed, pgpte), v2m(ed, pspte),                               \
                (l2_idx << L2_PAGETABLE_SHIFT) |                              \
                (l1_idx << L1_PAGETABLE_SHIFT));                              \
@@ -2741,7 +2746,7 @@ static int check_pte(
     gmfn = __gpfn_to_mfn(d, gpfn);
 
     if ( !VALID_MFN(gmfn) )
-        FAIL("invalid gpfn=%p gpte=%p\n", __func__, gpfn,
+        FAIL("%s: invalid gpfn=%lx gpte=%lx\n", __func__, gpfn,
              l1e_get_value(gpte));
 
     page_table_page = mfn_is_page_table(gmfn);
@@ -2749,7 +2754,7 @@ static int check_pte(
     if ( (l1e_get_flags(spte) & _PAGE_RW ) &&
          !(l1e_get_flags(gpte) & _PAGE_RW) && !oos_ptes )
     {
-        printk("gpfn=%p gmfn=%p smfn=%p t=0x%08x page_table_page=%d "
+        printk("gpfn=%lx gmfn=%lx smfn=%lx t=0x%08x page_table_page=%d "
                "oos_ptes=%d\n",
                gpfn, gmfn, smfn,
                frame_table[gmfn].u.inuse.type_info,
@@ -2763,7 +2768,7 @@ static int check_pte(
            (l1e_get_flags(gpte) & _PAGE_DIRTY)) &&
          !oos_ptes )
     {
-        printk("gpfn=%p gmfn=%p smfn=%p t=0x%08x page_table_page=%d "
+        printk("gpfn=%lx gmfn=%lx smfn=%lx t=0x%08x page_table_page=%d "
                "oos_ptes=%d\n",
                gpfn, gmfn, smfn,
                frame_table[gmfn].u.inuse.type_info,
@@ -2784,7 +2789,7 @@ static int check_pte(
         if ( level == 2 )
         {
             if ( __shadow_status(d, gpfn, PGT_l1_shadow) != smfn )
-                FAIL("smfn problem gpfn=%p smfn=%p", gpfn,
+                FAIL("smfn problem gpfn=%lx smfn=%lx", gpfn,
                      __shadow_status(d, gpfn, PGT_l1_shadow));
         }
         else
@@ -2846,7 +2851,7 @@ int check_l2_table(
     if ( oos_pdes && (page_get_owner(pfn_to_page(gmfn)) != NULL) )
         FAILPT("bogus owner for snapshot page");
     if ( page_get_owner(pfn_to_page(smfn)) != NULL )
-        FAILPT("shadow page mfn=0x%08x is owned by someone, domid=%d",
+        FAILPT("shadow page mfn=0x%lx is owned by someone, domid=%d",
                smfn, page_get_owner(pfn_to_page(smfn))->id);
 
 #if 0
@@ -2858,7 +2863,7 @@ int check_l2_table(
         for ( i = DOMAIN_ENTRIES_PER_L2_PAGETABLE; 
               i < (SH_LINEAR_PT_VIRT_START >> L2_PAGETABLE_SHIFT);
               i++ )
-            printk("+++ (%d) %p %p\n",i,
+            printk("+++ (%d) %lx %lx\n",i,
                    l2_pgentry_val(gpl2e[i]), l2_pgentry_val(spl2e[i]));
         FAILPT("hypervisor entries inconsistent");
     }
@@ -2873,7 +2878,7 @@ int check_l2_table(
          l2e_has_changed(&spl2e[SH_LINEAR_PT_VIRT_START >> L2_PAGETABLE_SHIFT],
                          &match, PAGE_FLAG_MASK))
     {
-        FAILPT("hypervisor shadow linear map inconsistent %p %p",
+        FAILPT("hypervisor shadow linear map inconsistent %lx %lx",
                l2e_get_value(spl2e[SH_LINEAR_PT_VIRT_START >>
                                    L2_PAGETABLE_SHIFT]),
                l2e_get_value(match));
@@ -2884,7 +2889,7 @@ int check_l2_table(
          l2e_has_changed(&spl2e[PERDOMAIN_VIRT_START >> L2_PAGETABLE_SHIFT],
                          &match, PAGE_FLAG_MASK))
     {
-        FAILPT("hypervisor per-domain map inconsistent saw %p, expected (va=%p) %p",
+        FAILPT("hypervisor per-domain map inconsistent saw %lx, expected (va=%p) %lx",
                l2e_get_value(spl2e[PERDOMAIN_VIRT_START >> L2_PAGETABLE_SHIFT]),
                d->arch.mm_perdomain_pt,
                l2e_get_value(match));
@@ -2942,7 +2947,7 @@ int _check_pagetable(struct exec_domain *ed, char *s)
 
     if ( !(smfn = __shadow_status(d, ptbase_pfn, PGT_base_page_table)) )
     {
-        printk("%s-PT %p not shadowed\n", s, gptbase);
+        printk("%s-PT %lx not shadowed\n", s, gptbase);
         goto out;
     }
     if ( page_out_of_sync(pfn_to_page(ptbase_mfn)) )
@@ -3038,8 +3043,8 @@ int _check_all_pagetables(struct exec_domain *ed, char *s)
                 break;
             default:
                 errors++;
-                printk("unexpected shadow type %p, gpfn=%p, "
-                       "gmfn=%p smfn=%p\n",
+                printk("unexpected shadow type %lx, gpfn=%lx, "
+                       "gmfn=%lx smfn=%lx\n",
                        a->gpfn_and_flags & PGT_type_mask,
                        a->gpfn_and_flags & PGT_mfn_mask,
                        gmfn, a->smfn);
index 547c7c9a357c9a335dcbcd7e207367159976fd65..a038afbedb5d0a722c69cc24c0493db4161d1f19 100644 (file)
@@ -360,7 +360,6 @@ int __init init_xen_time()
     wc_sec  = get_cmos_time();
 
     printk("Time init:\n");
-    printk(".... System Time: %lldns\n", NOW());
     printk(".... cpu_freq:    %08X:%08X\n", (u32)(cpu_freq>>32),(u32)cpu_freq);
     printk(".... scale:       %08X:%08X\n", (u32)(scale>>32),(u32)scale);
     printk(".... Wall Clock:  %lds %ldus\n", wc_sec, wc_usec);
index b819a79f499d4428a9821dc0f9adcbf264889010..948dd1802bc26c5aff5afc3fe6b3098a9e9a1679 100644 (file)
@@ -115,7 +115,7 @@ asmlinkage void fatal_trap(int trapnr, struct xen_regs *regs)
     if ( trapnr == TRAP_page_fault )
     {
         __asm__ __volatile__ ("mov %%cr2,%0" : "=r" (cr2) : );
-        printk("Faulting linear address might be %p\n", cr2);
+        printk("Faulting linear address might be %p\n", _p(cr2));
     }
 
     printk("************************************\n");
@@ -171,7 +171,7 @@ static inline int do_trap(int trapnr, char *str,
 
     if ( likely((fixup = search_exception_table(regs->eip)) != 0) )
     {
-        DPRINTK("Trap %d: %p -> %p\n", trapnr, regs->eip, fixup);
+        DPRINTK("Trap %d: %p -> %p\n", trapnr, _p(regs->eip), _p(fixup));
         regs->eip = fixup;
         return 0;
     }
@@ -336,7 +336,7 @@ asmlinkage int do_page_fault(struct xen_regs *regs)
     {
         perfc_incrc(copy_user_faults);
         if ( !shadow_mode_enabled(d) )
-            DPRINTK("Page fault: %p -> %p\n", regs->eip, fixup);
+            DPRINTK("Page fault: %p -> %p\n", _p(regs->eip), _p(fixup));
         regs->eip = fixup;
         return 0;
     }
@@ -709,7 +709,7 @@ static int emulate_privileged_op(struct xen_regs *regs)
         /* Ignore the instruction if unprivileged. */
         if ( !IS_PRIV(ed->domain) )
             DPRINTK("Non-priv domain attempted WRMSR(%p,%08lx,%08lx).\n",
-                    regs->ecx, (long)regs->eax, (long)regs->edx);
+                    _p(regs->ecx), (long)regs->eax, (long)regs->edx);
         else if ( wrmsr_user(regs->ecx, regs->eax, regs->edx) )
             goto fail;
         break;
@@ -717,7 +717,7 @@ static int emulate_privileged_op(struct xen_regs *regs)
     case 0x32: /* RDMSR */
         if ( !IS_PRIV(ed->domain) )
             DPRINTK("Non-priv domain attempted RDMSR(%p,%08lx,%08lx).\n",
-                    regs->ecx, (long)regs->eax, (long)regs->edx);
+                    _p(regs->ecx), (long)regs->eax, (long)regs->edx);
         /* Everyone can read the MSR space. */
         if ( rdmsr_user(regs->ecx, regs->eax, regs->edx) )
             goto fail;
@@ -824,7 +824,7 @@ asmlinkage int do_general_protection(struct xen_regs *regs)
     if ( likely((fixup = search_exception_table(regs->eip)) != 0) )
     {
         DPRINTK("GPF (%04x): %p -> %p\n",
-                regs->error_code, regs->eip, fixup);
+                regs->error_code, _p(regs->eip), _p(fixup));
         regs->eip = fixup;
         return 0;
     }
index 77c87c7953cc338e6a586389f82a2027890ac841..db82c73eac5ca50f7955a7df25b553025ab4c86f 100644 (file)
@@ -118,7 +118,7 @@ static int vmx_do_page_fault(unsigned long va, struct xen_regs *regs)
         __vmread(GUEST_EIP, &eip);
         VMX_DBG_LOG(DBG_LEVEL_VMMU, 
                 "vmx_do_page_fault = 0x%lx, eip = %lx, error_code = %lx",
-                va, eip, regs->error_code);
+                va, eip, (unsigned long)regs->error_code);
     }
 #endif
 
@@ -163,12 +163,14 @@ static void vmx_do_general_protection_fault(struct xen_regs *regs)
     __vmread(VM_EXIT_INTR_ERROR_CODE, &error_code);
 
     VMX_DBG_LOG(DBG_LEVEL_1,
-            "vmx_general_protection_fault: eip = %lx, erro_code = %lx",
-            eip, error_code);
+                "vmx_general_protection_fault: eip = %lx, erro_code = %lx",
+                eip, error_code);
 
     VMX_DBG_LOG(DBG_LEVEL_1,
-            "eax=%lx, ebx=%lx, ecx=%lx, edx=%lx, esi=%lx, edi=%lx",
-            regs->eax, regs->ebx, regs->ecx, regs->edx, regs->esi, regs->edi);
+                "eax=%lx, ebx=%lx, ecx=%lx, edx=%lx, esi=%lx, edi=%lx",
+                (unsigned long)regs->eax, (unsigned long)regs->ebx,
+                (unsigned long)regs->ecx, (unsigned long)regs->edx,
+                (unsigned long)regs->esi, (unsigned long)regs->edi);
 
     /* Reflect it back into the guest */
     intr_fields = (INTR_INFO_VALID_MASK | 
@@ -189,8 +191,9 @@ static void vmx_vmexit_do_cpuid(unsigned long input, struct xen_regs *regs)
     VMX_DBG_LOG(DBG_LEVEL_1, 
                 "do_cpuid: (eax) %lx, (ebx) %lx, (ecx) %lx, (edx) %lx,"
                 " (esi) %lx, (edi) %lx",
-                regs->eax, regs->ebx, regs->ecx, regs->edx,
-                regs->esi, regs->edi);
+                (unsigned long)regs->eax, (unsigned long)regs->ebx,
+                (unsigned long)regs->ecx, (unsigned long)regs->edx,
+                (unsigned long)regs->esi, (unsigned long)regs->edi);
 
     cpuid(input, &eax, &ebx, &ecx, &edx);
 
@@ -275,7 +278,7 @@ static void vmx_vmexit_do_invlpg(unsigned long va)
 
     __vmread(GUEST_EIP, &eip);
 
-    VMX_DBG_LOG(DBG_LEVEL_VMMU, "vmx_vmexit_do_invlpg: eip=%p, va=%p",
+    VMX_DBG_LOG(DBG_LEVEL_VMMU, "vmx_vmexit_do_invlpg: eip=%lx, va=%lx",
                 eip, va);
 
     /*
@@ -301,8 +304,9 @@ static void vmx_io_instruction(struct xen_regs *regs,
     vm86 = eflags & X86_EFLAGS_VM ? 1 : 0;
 
     VMX_DBG_LOG(DBG_LEVEL_1, 
-            "vmx_io_instruction: vm86 %d, eip=%p:%p, exit_qualification = %lx",
-            vm86, cs, eip, exit_qualification);
+                "vmx_io_instruction: vm86 %d, eip=%lx:%lx, "
+                "exit_qualification = %lx",
+                vm86, cs, eip, exit_qualification);
 
     if (test_bit(6, &exit_qualification))
         addr = (exit_qualification >> 16) & (0xffff);
@@ -915,13 +919,15 @@ static int vmx_cr_access(unsigned long exit_qualification, struct xen_regs *regs
 static inline void vmx_do_msr_read(struct xen_regs *regs)
 {
     VMX_DBG_LOG(DBG_LEVEL_1, "vmx_do_msr_read: ecx=%lx, eax=%lx, edx=%lx",
-            regs->ecx, regs->eax, regs->edx);
+                (unsigned long)regs->ecx, (unsigned long)regs->eax, 
+                (unsigned long)regs->edx);
 
     rdmsr(regs->ecx, regs->eax, regs->edx);
 
     VMX_DBG_LOG(DBG_LEVEL_1, "vmx_do_msr_read returns: "
                 "ecx=%lx, eax=%lx, edx=%lx",
-                regs->ecx, regs->eax, regs->edx);
+                (unsigned long)regs->ecx, (unsigned long)regs->eax,
+                (unsigned long)regs->edx);
 }
 
 /*
@@ -933,7 +939,7 @@ static inline void vmx_vmexit_do_hlt(void)
     unsigned long eip;
     __vmread(GUEST_EIP, &eip);
 #endif
-    VMX_DBG_LOG(DBG_LEVEL_1, "vmx_vmexit_do_hlt:eip=%p", eip);
+    VMX_DBG_LOG(DBG_LEVEL_1, "vmx_vmexit_do_hlt:eip=%lx", eip);
     raise_softirq(SCHEDULE_SOFTIRQ);
 }
 
@@ -943,7 +949,7 @@ static inline void vmx_vmexit_do_mwait(void)
     unsigned long eip;
     __vmread(GUEST_EIP, &eip);
 #endif
-    VMX_DBG_LOG(DBG_LEVEL_1, "vmx_vmexit_do_mwait:eip=%p", eip);
+    VMX_DBG_LOG(DBG_LEVEL_1, "vmx_vmexit_do_mwait:eip=%lx", eip);
     raise_softirq(SCHEDULE_SOFTIRQ);
 }
 
@@ -1097,9 +1103,10 @@ asmlinkage void vmx_vmexit_handler(struct xen_regs regs)
             __vmread(EXIT_QUALIFICATION, &va);
             __vmread(VM_EXIT_INTR_ERROR_CODE, &regs.error_code);
             VMX_DBG_LOG(DBG_LEVEL_VMMU, 
-                    "eax=%lx, ebx=%lx, ecx=%lx, edx=%lx, esi=%lx, edi=%lx",
-                        regs.eax, regs.ebx, regs.ecx, regs.edx, regs.esi,
-                        regs.edi);
+                        "eax=%lx, ebx=%lx, ecx=%lx, edx=%lx, esi=%lx, edi=%lx",
+                        (unsigned long)regs.eax, (unsigned long)regs.ebx,
+                        (unsigned long)regs.ecx, (unsigned long)regs.edx,
+                        (unsigned long)regs.esi, (unsigned long)regs.edi);
             ed->arch.arch_vmx.vmx_platform.mpci.inst_decoder_regs = &regs;
 
             if (!(error = vmx_do_page_fault(va, &regs))) {
@@ -1219,8 +1226,8 @@ asmlinkage void vmx_vmexit_handler(struct xen_regs regs)
         break;
     case EXIT_REASON_MSR_WRITE:
         __vmread(GUEST_EIP, &eip);
-        VMX_DBG_LOG(DBG_LEVEL_1, "MSR_WRITE: eip=%p, eax=%p, edx=%p",
-                eip, regs.eax, regs.edx);
+        VMX_DBG_LOG(DBG_LEVEL_1, "MSR_WRITE: eip=%lx, eax=%lx, edx=%lx",
+                eip, (unsigned long)regs.eax, (unsigned long)regs.edx);
         /* just ignore this point */
         __get_instruction_length(inst_len);
         __update_guest_eip(inst_len);
index 81b3f789fd6c9940937247c3b45c804c6326e589..e7ef63bf9b94d53f7a320e461e823ffc2a16ff4e 100644 (file)
@@ -222,7 +222,7 @@ void vmx_hooks_assist(struct exec_domain *d)
         /* frequency(ms) of pit */
         vpit->period = DIV_ROUND(((vpit->init_val) * 1000), PIT_FREQ); 
         if (vpit->period < 1) {
-            printk("VMX_PIT: guest programmed too small an init_val: %lx\n",
+            printk("VMX_PIT: guest programmed too small an init_val: %x\n",
                    vpit->init_val);
             vpit->period = 1;
         }
index 358ce4bcc625841c71624ee2e13aec4e64ec994d..70bccd4017643c863c38046056d183e10dd687d9 100644 (file)
@@ -31,7 +31,7 @@ void show_guest_stack(void)
     int i;
     execution_context_t *ec = get_execution_context();
     unsigned long *stack = (unsigned long *)ec->esp;
-    printk("Guest EIP is %lx\n   ",ec->eip);
+    printk("Guest EIP is %08x\n   ", ec->eip);
 
     for ( i = 0; i < kstack_depth_to_print; i++ )
     {
@@ -39,7 +39,7 @@ void show_guest_stack(void)
             break;
         if ( i && ((i % 8) == 0) )
             printk("\n   ");
-            printk("%p ", *stack++);            
+        printk("%08lx ", *stack++);
     }
     printk("\n");
     
@@ -58,7 +58,7 @@ void show_trace(unsigned long *esp)
         if (kernel_text_address(addr)) {
             if (i && ((i % 6) == 0))
                 printk("\n   ");
-            printk("[<%p>] ", addr);
+            printk("[<%08lx>] ", addr);
             i++;
         }
     }
@@ -80,9 +80,9 @@ void show_stack(unsigned long *esp)
         if ( i && ((i % 8) == 0) )
             printk("\n   ");
         if ( kernel_text_address(*stack) )
-            printk("[%p] ", *stack++);
+            printk("[%08lx] ", *stack++);
         else
-            printk("%p ", *stack++);            
+            printk("%08lx ", *stack++);
     }
     printk("\n");
 
@@ -140,13 +140,16 @@ void show_registers(struct xen_regs *regs)
         }
     }
 
-    printk("CPU:    %d\nEIP:    %04lx:[<%p>]      \nEFLAGS: %p   CONTEXT: %s\n",
-           smp_processor_id(), 0xffff & regs->cs, eip, eflags, context);
-    printk("eax: %p   ebx: %p   ecx: %p   edx: %p\n",
+    printk("CPU:    %d\nEIP:    %04lx:[<%08lx>]      \nEFLAGS: %08lx   "
+           "CONTEXT: %s\n",
+           smp_processor_id(), (unsigned long)0xffff & regs->cs,
+           eip, eflags, context);
+    printk("eax: %08x   ebx: %08x   ecx: %08x   edx: %08x\n",
            regs->eax, regs->ebx, regs->ecx, regs->edx);
-    printk("esi: %p   edi: %p   ebp: %p   esp: %p\n",
+    printk("esi: %08x   edi: %08x   ebp: %08x   esp: %08lx\n",
            regs->esi, regs->edi, regs->ebp, esp);
-    printk("ds: %04x   es: %04x   fs: %04x   gs: %04x   ss: %04x   cs: %04x\n",
+    printk("ds: %04lx   es: %04lx   fs: %04lx   gs: %04lx   "
+           "ss: %04lx   cs: %04lx\n",
            ds, es, fs, gs, ss, cs);
 
     show_stack((unsigned long *)&regs->esp);
@@ -161,16 +164,16 @@ void show_page_walk(unsigned long addr)
     if ( addr < PAGE_OFFSET )
         return;
 
-    printk("Pagetable walk from %p:\n", addr);
+    printk("Pagetable walk from %08lx:\n", addr);
     
     page = l2e_get_value(idle_pg_table[l2_table_offset(addr)]);
-    printk(" L2 = %p %s\n", page, (page & _PAGE_PSE) ? "(4MB)" : "");
+    printk(" L2 = %08lx %s\n", page, (page & _PAGE_PSE) ? "(4MB)" : "");
     if ( !(page & _PAGE_PRESENT) || (page & _PAGE_PSE) )
         return;
 
     page &= PAGE_MASK;
     page = ((unsigned long *) __va(page))[l1_table_offset(addr)];
-    printk("  L1 = %p\n", page);
+    printk("  L1 = %08lx\n", page);
 }
 
 #define DOUBLEFAULT_STACK_SIZE 1024
index 78fb464407441dbf593956da5bc863f2d0a5a046..b93bc230d50c76c9351a1026a2442d9f9f44bc82 100644 (file)
@@ -204,7 +204,7 @@ void subarch_init_memory(struct domain *dom_xen)
     if ( (offsetof(struct pfn_info, u.inuse._domain) != 
           (offsetof(struct pfn_info, count_info) + sizeof(u32))) )
     {
-        printk("Weird pfn_info layout (%ld,%ld,%d)\n",
+        printk("Weird pfn_info layout (%ld,%ld,%ld)\n",
                offsetof(struct pfn_info, count_info),
                offsetof(struct pfn_info, u.inuse._domain),
                sizeof(struct pfn_info));
index 2c74f27d0ce8f06a06ffbe348f095ecc95fd793e..3bfc85e97c8779ce709f269c7cd8d8dc4afd9f75 100644 (file)
@@ -26,7 +26,7 @@ void show_guest_stack(void)
     int i;
     execution_context_t *ec = get_execution_context();
     unsigned long *stack = (unsigned long *)ec->rsp;
-    printk("Guest RIP is %lx\n   ", ec->rip);
+    printk("Guest RIP is %016lx\n   ", ec->rip);
 
     for ( i = 0; i < kstack_depth_to_print; i++ )
     {
@@ -34,7 +34,7 @@ void show_guest_stack(void)
             break;
         if ( i && ((i % 8) == 0) )
             printk("\n    ");
-            printk("%p ", *stack++);
+            printk("%016lx ", *stack++);
     }
     printk("\n");
     
@@ -53,7 +53,7 @@ void show_trace(unsigned long *rsp)
         if (kernel_text_address(addr)) {
             if (i && ((i % 6) == 0))
                 printk("\n   ");
-            printk("[<%p>] ", addr);
+            printk("[<%016lx>] ", addr);
             i++;
         }
     }
@@ -75,9 +75,9 @@ void show_stack(unsigned long *rsp)
         if ( i && ((i % 8) == 0) )
             printk("\n    ");
         if ( kernel_text_address(*stack) )
-            printk("[%p] ", *stack++);
+            printk("[%016lx] ", *stack++);
         else
-            printk("%p ", *stack++);            
+            printk("%016lx ", *stack++);            
     }
     printk("\n");
 
@@ -86,15 +86,15 @@ void show_stack(unsigned long *rsp)
 
 void show_registers(struct xen_regs *regs)
 {
-    printk("CPU:    %d\nEIP:    %04lx:[<%p>]      \nEFLAGS: %p\n",
+    printk("CPU:    %d\nEIP:    %04lx:[<%016lx>]      \nEFLAGS: %016lx\n",
            smp_processor_id(), 0xffff & regs->cs, regs->rip, regs->eflags);
-    printk("rax: %p   rbx: %p   rcx: %p   rdx: %p\n",
+    printk("rax: %016lx   rbx: %016lx   rcx: %016lx   rdx: %016lx\n",
            regs->rax, regs->rbx, regs->rcx, regs->rdx);
-    printk("rsi: %p   rdi: %p   rbp: %p   rsp: %p\n",
+    printk("rsi: %016lx   rdi: %016lx   rbp: %016lx   rsp: %016lx\n",
            regs->rsi, regs->rdi, regs->rbp, regs->rsp);
-    printk("r8:  %p   r9:  %p   r10: %p   r11: %p\n",
+    printk("r8:  %016lx   r9:  %016lx   r10: %016lx   r11: %016lx\n",
            regs->r8,  regs->r9,  regs->r10, regs->r11);
-    printk("r12: %p   r13: %p   r14: %p   r15: %p\n",
+    printk("r12: %016lx   r13: %016lx   r14: %016lx   r15: %016lx\n",
            regs->r12, regs->r13, regs->r14, regs->r15);
 
     show_stack((unsigned long *)regs->rsp);
@@ -104,29 +104,29 @@ void show_page_walk(unsigned long addr)
 {
     unsigned long page = read_cr3();
     
-    printk("Pagetable walk from %p:\n", addr);
+    printk("Pagetable walk from %016lx:\n", addr);
 
     page &= PAGE_MASK;
     page = ((unsigned long *) __va(page))[l4_table_offset(addr)];
-    printk(" L4 = %p\n", page);
+    printk(" L4 = %016lx\n", page);
     if ( !(page & _PAGE_PRESENT) )
         return;
 
     page &= PAGE_MASK;
     page = ((unsigned long *) __va(page))[l3_table_offset(addr)];
-    printk("  L3 = %p\n", page);
+    printk("  L3 = %016lx\n", page);
     if ( !(page & _PAGE_PRESENT) )
         return;
 
     page &= PAGE_MASK;
     page = ((unsigned long *) __va(page))[l2_table_offset(addr)];
-    printk("   L2 = %p %s\n", page, (page & _PAGE_PSE) ? "(2MB)" : "");
+    printk("   L2 = %016lx %s\n", page, (page & _PAGE_PSE) ? "(2MB)" : "");
     if ( !(page & _PAGE_PRESENT) || (page & _PAGE_PSE) )
         return;
 
     page &= PAGE_MASK;
     page = ((unsigned long *) __va(page))[l1_table_offset(addr)];
-    printk("    L1 = %p\n", page);
+    printk("    L1 = %016lx\n", page);
 }
 
 asmlinkage void double_fault(void);
index 756c26b17cba46ec99a4cc40a5d4447e138b3c85..698f6ee835c5aa388156a95b0b1cad920a557580 100644 (file)
@@ -94,7 +94,7 @@ free_dom_mem(struct domain *d,
         {
             if ( unlikely((mpfn + j) >= max_page) )
             {
-                DPRINTK("Domain %u page number out of range (%p>=%p)\n", 
+                DPRINTK("Domain %u page number out of range (%lx >= %lx)\n", 
                         d->id, mpfn + j, max_page);
                 return i;
             }
index 8cf46378c3e49c480fa0df1baa4fe7fc0a593666..ca7ee36495cfa51635429c6ab8aec402600d0d79 100644 (file)
@@ -341,7 +341,7 @@ __gnttab_map_grant_ref(
     if ( ((host_virt_addr != 0) || (dev_hst_ro_flags & GNTMAP_host_map)) &&
          unlikely(!__addr_ok(host_virt_addr)))
     {
-        DPRINTK("Bad virtual address (%x) or flags (%x).\n",
+        DPRINTK("Bad virtual address (%lx) or flags (%x).\n",
                 host_virt_addr, dev_hst_ro_flags);
         (void)__put_user(GNTST_bad_virt_addr, &uop->handle);
         return GNTST_bad_gntref;
@@ -552,7 +552,7 @@ __gnttab_unmap_grant_ref(
 
         if ( unlikely(__get_user(_ol1e, (unsigned long *)pl1e) != 0) )
         {
-            DPRINTK("Could not find PTE entry for address %x\n", virt);
+            DPRINTK("Could not find PTE entry for address %lx\n", virt);
             rc = -EINVAL;
             goto unmap_out;
         }
@@ -563,7 +563,7 @@ __gnttab_unmap_grant_ref(
          */
         if ( unlikely((_ol1e >> PAGE_SHIFT) != frame ))
         {
-            DPRINTK("PTE entry %x for address %x doesn't match frame %x\n",
+            DPRINTK("PTE entry %lx for address %lx doesn't match frame %lx\n",
                     _ol1e, virt, frame);
             rc = -EINVAL;
             goto unmap_out;
@@ -572,7 +572,7 @@ __gnttab_unmap_grant_ref(
         /* Delete pagetable entry. */
         if ( unlikely(__put_user(0, (unsigned long *)pl1e)))
         {
-            DPRINTK("Cannot delete PTE entry at %x for virtual address %x\n",
+            DPRINTK("Cannot delete PTE entry at %p for virtual address %lx\n",
                     pl1e, virt);
             rc = -EINVAL;
             goto unmap_out;
@@ -912,7 +912,7 @@ gnttab_check_unmap(
             }
 
             /* gotcha */
-            DPRINTK("Grant unref rd(%d) ld(%d) frm(%x) flgs(%x).\n",
+            DPRINTK("Grant unref rd(%d) ld(%d) frm(%lx) flgs(%x).\n",
                     rd->id, ld->id, frame, readonly);
 
             if ( readonly )
@@ -985,7 +985,7 @@ gnttab_prepare_for_transfer(
 
         if ( unlikely(target_pfn >= max_page ) )
         {
-            DPRINTK("Bad pfn (%x)\n", target_pfn);
+            DPRINTK("Bad pfn (%lx)\n", target_pfn);
             goto fail;
         }
 
@@ -1050,7 +1050,7 @@ gnttab_notify_transfer(
     pfn = sha->frame;
 
     if ( unlikely(pfn >= max_page ) )
-        DPRINTK("Bad pfn (%x)\n", pfn);
+        DPRINTK("Bad pfn (%lx)\n", pfn);
     else
     {
         machine_to_phys_mapping[frame] = pfn;
index c6515d7a9b58ef6532137a32a1ceba019da5af3c..fdfe7864db23bccae8a249178c8443a6faaad9e3 100644 (file)
@@ -27,7 +27,7 @@ long do_multicall(multicall_entry_t *call_list, unsigned int nr_calls)
     if ( unlikely(!array_access_ok(call_list, nr_calls, sizeof(*call_list))) )
     {
         DPRINTK("Bad memory range %p for %u*%u bytes.\n",
-                call_list, nr_calls, sizeof(*call_list));
+                call_list, nr_calls, (unsigned int)sizeof(*call_list));
         goto fault;
     }
 
@@ -37,7 +37,7 @@ long do_multicall(multicall_entry_t *call_list, unsigned int nr_calls)
                                        sizeof(*call_list))) )
         {
             DPRINTK("Error copying from user range %p for %u bytes.\n",
-                    &call_list[i], sizeof(*call_list));
+                    &call_list[i], (unsigned int)sizeof(*call_list));
             goto fault;
         }
 
index 7b6f0b13aecbb2a6cc8aba0ce34dbd35ece3a333..5573ced9572e28cc4f6629bd944ff2a6b2a741e2 100644 (file)
@@ -171,7 +171,7 @@ void init_boot_pages(unsigned long ps, unsigned long pe)
 
         if ( (bad_pfn < (bitmap_size*8)) && !allocated_in_map(bad_pfn) )
         {
-            printk("Marking page %p as bad\n", bad_pfn);
+            printk("Marking page %lx as bad\n", bad_pfn);
             map_alloc(bad_pfn, 1);
         }
     }
index ddb30d86e93f2dd3015877a4c45a34ab16b23d8f..99e020840600f37c3be91c5145cbd3fd50016590 100644 (file)
@@ -183,7 +183,7 @@ static inline int get_page(struct pfn_info *page,
              unlikely(d != _domain) )                /* Wrong owner? */
         {
             if ( !_shadow_mode_enabled(domain) )
-                DPRINTK("Error pfn %p: rd=%p, od=%p, caf=%08x, taf=%08x\n",
+                DPRINTK("Error pfn %lx: rd=%p, od=%p, caf=%08x, taf=%08x\n",
                         page_to_pfn(page), domain, unpickle_domptr(d),
                         x, page->u.inuse.type_info);
             return 0;
@@ -263,9 +263,9 @@ static inline unsigned long phys_to_machine_mapping(unsigned long pfn)
     unsigned long mfn;
     l1_pgentry_t pte;
 
-    if (!__copy_from_user(&pte, (__phys_to_machine_mapping + pfn),
-                         sizeof(pte))
-       && (l1e_get_flags(pte) & _PAGE_PRESENT) )
+    if ( (__copy_from_user(&pte, &__phys_to_machine_mapping[pfn],
+                           sizeof(pte)) == 0) &&
+         (l1e_get_flags(pte) & _PAGE_PRESENT) )
        mfn = l1e_get_pfn(pte);
     else
        mfn = INVALID_MFN;
index c17599afd2e5f6ec43f2e5922b22fccba7be7db1..88ea9e6dac94971d335c9a22328389c9bee90b45 100644 (file)
@@ -304,7 +304,7 @@ shadow_get_page_from_l1e(l1_pgentry_t l1e, struct domain *d)
          (d != owner) )
     {
         res = get_page_from_l1e(nl1e, owner);
-        printk("tried to map mfn %p from domain %d into shadow page tables "
+        printk("tried to map mfn %lx from domain %d into shadow page tables "
                "of domain %d; %s\n",
                mfn, owner->id, d->id, res ? "success" : "failed");
     }
@@ -312,7 +312,8 @@ shadow_get_page_from_l1e(l1_pgentry_t l1e, struct domain *d)
     if ( unlikely(!res) )
     {
         perfc_incrc(shadow_get_page_fail);
-        FSH_LOG("%s failed to get ref l1e=%p\n", __func__, l1e_get_value(l1e));
+        FSH_LOG("%s failed to get ref l1e=%lx\n",
+                __func__, l1e_get_value(l1e));
     }
 
     return res;
@@ -369,7 +370,7 @@ update_hl2e(struct exec_domain *ed, unsigned long va)
     old_hl2e = ed->arch.hl2_vtable[index];
 
     if ( (l2e_get_flags(gl2e) & _PAGE_PRESENT) &&
-         VALID_MFN(mfn = phys_to_machine_mapping(l2e_get_pfn(gl2e)) ))
+         VALID_MFN(mfn = phys_to_machine_mapping(l2e_get_pfn(gl2e)))
         new_hl2e = l1e_create_pfn(mfn, __PAGE_HYPERVISOR);
     else
         new_hl2e = l1e_empty();
@@ -405,16 +406,16 @@ static inline void shadow_drop_references(
         return;
 
     /* XXX This needs more thought... */
-    printk("%s: needing to call shadow_remove_all_access for mfn=%p\n",
+    printk("%s: needing to call shadow_remove_all_access for mfn=%lx\n",
            __func__, page_to_pfn(page));
-    printk("Before: mfn=%p c=%p t=%p\n", page_to_pfn(page),
+    printk("Before: mfn=%lx c=%08x t=%08x\n", page_to_pfn(page),
            page->count_info, page->u.inuse.type_info);
 
     shadow_lock(d);
     shadow_remove_all_access(d, page_to_pfn(page));
     shadow_unlock(d);
 
-    printk("After:  mfn=%p c=%p t=%p\n", page_to_pfn(page),
+    printk("After:  mfn=%lx c=%08x t=%08x\n", page_to_pfn(page),
            page->count_info, page->u.inuse.type_info);
 }
 
@@ -452,8 +453,9 @@ get_shadow_ref(unsigned long smfn)
 
     if ( unlikely(nx == 0) )
     {
-        printk("get_shadow_ref overflow, gmfn=%p smfn=%p\n",
-               frame_table[smfn].u.inuse.type_info & PGT_mfn_mask, smfn);
+        printk("get_shadow_ref overflow, gmfn=%x smfn=%lx\n",
+               frame_table[smfn].u.inuse.type_info & PGT_mfn_mask,
+               smfn);
         BUG();
     }
     
@@ -481,7 +483,7 @@ put_shadow_ref(unsigned long smfn)
 
     if ( unlikely(x == 0) )
     {
-        printk("put_shadow_ref underflow, smfn=%p oc=%p t=%p\n",
+        printk("put_shadow_ref underflow, smfn=%lx oc=%08x t=%08x\n",
                smfn,
                frame_table[smfn].count_info,
                frame_table[smfn].u.inuse.type_info);
@@ -592,11 +594,11 @@ static inline int l1pte_write_fault(
     unsigned long gpfn = l1e_get_pfn(gpte);
     unsigned long gmfn = __gpfn_to_mfn(d, gpfn);
 
-    //printk("l1pte_write_fault gmfn=%p\n", gmfn);
+    //printk("l1pte_write_fault gmfn=%lx\n", gmfn);
 
     if ( unlikely(!VALID_MFN(gmfn)) )
     {
-        SH_LOG("l1pte_write_fault: invalid gpfn=%p", gpfn);
+        SH_LOG("l1pte_write_fault: invalid gpfn=%lx", gpfn);
         *spte_p = l1e_empty();
         return 0;
     }
@@ -605,7 +607,7 @@ static inline int l1pte_write_fault(
     l1e_add_flags(&gpte, _PAGE_DIRTY | _PAGE_ACCESSED);
     spte = l1e_create_pfn(gmfn, l1e_get_flags(gpte) & ~_PAGE_GLOBAL);
 
-    SH_VVLOG("l1pte_write_fault: updating spte=0x%p gpte=0x%p",
+    SH_VVLOG("l1pte_write_fault: updating spte=0x%lx gpte=0x%lx",
              l1e_get_value(spte), l1e_get_value(gpte));
 
     if ( shadow_mode_log_dirty(d) )
@@ -630,7 +632,7 @@ static inline int l1pte_read_fault(
 
     if ( unlikely(!VALID_MFN(mfn)) )
     {
-        SH_LOG("l1pte_read_fault: invalid gpfn=%p", pfn);
+        SH_LOG("l1pte_read_fault: invalid gpfn=%lx", pfn);
         *spte_p = l1e_empty();
         return 0;
     }
@@ -644,7 +646,7 @@ static inline int l1pte_read_fault(
         l1e_remove_flags(&spte, _PAGE_RW);
     }
 
-    SH_VVLOG("l1pte_read_fault: updating spte=0x%p gpte=0x%p",
+    SH_VVLOG("l1pte_read_fault: updating spte=0x%lx gpte=0x%lx",
              l1e_get_value(spte), l1e_get_value(gpte));
     *gpte_p = gpte;
     *spte_p = spte;
@@ -675,7 +677,7 @@ static inline void l1pte_propagate_from_guest(
     }
 
     if ( l1e_get_value(spte) || l1e_get_value(gpte) )
-        SH_VVVLOG("%s: gpte=%p, new spte=%p",
+        SH_VVVLOG("%s: gpte=%lx, new spte=%lx",
                   __func__, l1e_get_value(gpte), l1e_get_value(spte));
 
     *spte_p = spte;
@@ -709,7 +711,7 @@ static inline void hl2e_propagate_from_guest(
     }
 
     if ( l1e_get_value(hl2e) || l2e_get_value(gpde) )
-        SH_VVLOG("%s: gpde=%p hl2e=%p", __func__,
+        SH_VVLOG("%s: gpde=%lx hl2e=%lx", __func__,
                  l2e_get_value(gpde), l1e_get_value(hl2e));
 
     *hl2e_p = hl2e;
@@ -739,7 +741,7 @@ static inline void l2pde_general(
     }
 
     if ( l2e_get_value(spde) || l2e_get_value(gpde) )
-        SH_VVLOG("%s: gpde=%p, new spde=%p", __func__,
+        SH_VVLOG("%s: gpde=%lx, new spde=%lx", __func__,
                  l2e_get_value(gpde), l2e_get_value(spde));
 
     *spde_p = spde;
@@ -771,7 +773,7 @@ validate_pte_change(
     perfc_incrc(validate_pte_calls);
 
 #if 0
-    FSH_LOG("validate_pte(old=%p new=%p)", old_pte, new_pte);
+    FSH_LOG("validate_pte(old=%lx new=%lx)", old_pte, new_pte);
 #endif
 
     old_spte = *shadow_pte_p;
@@ -897,7 +899,7 @@ static void shadow_audit(struct domain *d, int print)
             live++; 
             if ( (a->gpfn_and_flags == 0) || (a->smfn == 0) )
             {
-                printk("XXX live=%d gpfn+flags=%p sp=%p next=%p\n",
+                printk("XXX live=%d gpfn+flags=%lx sp=%lx next=%p\n",
                        live, a->gpfn_and_flags, a->smfn, a->next);
                 BUG();
             }
@@ -1161,7 +1163,7 @@ static inline void delete_shadow_status(
 
     head = hash_bucket(d, gpfn);
 
-    SH_VLOG("delete gpfn=%p t=%p bucket=%p", gpfn, stype, head);
+    SH_VLOG("delete gpfn=%lx t=%08x bucket=%p", gpfn, stype, head);
     shadow_audit(d, 0);
 
     /* Match on head item? */
@@ -1235,7 +1237,7 @@ static inline void set_shadow_status(
     int i;
     unsigned long key = gpfn | stype;
 
-    SH_VVLOG("set gpfn=%p gmfn=%p smfn=%p t=%p", gpfn, gmfn, smfn, stype);
+    SH_VVLOG("set gpfn=%lx gmfn=%lx smfn=%lx t=%lx", gpfn, gmfn, smfn, stype);
 
     ASSERT(spin_is_locked(&d->arch.shadow_lock));
 
@@ -1249,7 +1251,7 @@ static inline void set_shadow_status(
 
     x = head = hash_bucket(d, gpfn);
    
-    SH_VLOG("set gpfn=%p smfn=%p t=%p bucket=%p(%p)",
+    SH_VLOG("set gpfn=%lx smfn=%lx t=%lx bucket=%p(%p)",
              gpfn, smfn, stype, x, x->next);
     shadow_audit(d, 0);
 
@@ -1463,7 +1465,7 @@ static inline l1_pgentry_t gva_to_gpte(unsigned long gva)
                                    &linear_pg_table[gva >> PAGE_SHIFT],
                                    sizeof(gpte))) )
     {
-        FSH_LOG("gva_to_gpte got a fault on gva=%p", gva);
+        FSH_LOG("gva_to_gpte got a fault on gva=%lx", gva);
         return l1e_empty();
     }
 
index 5fa3d6b96ab3e400bbefd0a31edc4070c8ad57e1..b48971921ca20d1994f3d304c81680ea7dfcd405 100644 (file)
@@ -29,18 +29,18 @@ typedef struct { u32 l1_lo; } l1_pgentry_t;
 typedef struct { u32 l2_lo; } l2_pgentry_t;
 typedef l2_pgentry_t root_pgentry_t;
 
-/* read access (depricated) */
-#define l1e_get_value(_x)         ((_x).l1_lo)
-#define l2e_get_value(_x)         ((_x).l2_lo)
+/* read access (deprecated) */
+#define l1e_get_value(_x)      ((unsigned long)((_x).l1_lo))
+#define l2e_get_value(_x)      ((unsigned long)((_x).l2_lo))
 
 /* read access */
-#define l1e_get_pfn(_x)           ((_x).l1_lo >> PAGE_SHIFT)
-#define l1e_get_phys(_x)          ((_x).l1_lo &  PAGE_MASK)
-#define l1e_get_flags(_x)         ((_x).l1_lo &  PAGE_FLAG_MASK)
+#define l1e_get_pfn(_x)        ((unsigned long)((_x).l1_lo >> PAGE_SHIFT))
+#define l1e_get_phys(_x)       ((unsigned long)((_x).l1_lo &  PAGE_MASK))
+#define l1e_get_flags(_x)      ((unsigned long)((_x).l1_lo &  PAGE_FLAG_MASK))
 
-#define l2e_get_pfn(_x)           ((_x).l2_lo >> PAGE_SHIFT)
-#define l2e_get_phys(_x)          ((_x).l2_lo &  PAGE_MASK)
-#define l2e_get_flags(_x)         ((_x).l2_lo &  PAGE_FLAG_MASK)
+#define l2e_get_pfn(_x)        ((unsigned long)((_x).l2_lo >> PAGE_SHIFT))
+#define l2e_get_phys(_x)       ((unsigned long)((_x).l2_lo &  PAGE_MASK))
+#define l2e_get_flags(_x)      ((unsigned long)((_x).l2_lo &  PAGE_FLAG_MASK))
 
 /* write access */
 static inline l1_pgentry_t l1e_empty(void)
index d80bc4a4c16d92616507631eb630063b531072e4..313635f82a52abd7410fa90f8f11e8373b3d032a 100644 (file)
@@ -40,17 +40,20 @@ extern void debugtrace_printk(const char *fmt, ...);
 #define debugtrace_printk(_f, ...) ((void)0)
 #endif
 
-#define printk printf
-void printf(const char *format, ...);
-void panic(const char *format, ...);
-long vm_assist(struct domain *, unsigned int, unsigned int);
+/* Allows us to use '%p' as general-purpose machine-word format char. */
+#define _p(_x) ((void *)(unsigned long)(_x))
+#define printk(_f , _a...) printf( _f , ## _a )
+extern void printf(const char *format, ...)
+    __attribute__ ((format (printf, 1, 2)));
+extern void panic(const char *format, ...);
+extern long vm_assist(struct domain *, unsigned int, unsigned int);
 
 /* vsprintf.c */
 extern int sprintf(char * buf, const char * fmt, ...)
-       __attribute__ ((format (printf, 2, 3)));
+    __attribute__ ((format (printf, 2, 3)));
 extern int vsprintf(char *buf, const char *, va_list);
 extern int snprintf(char * buf, size_t size, const char * fmt, ...)
-       __attribute__ ((format (printf, 3, 4)));
+    __attribute__ ((format (printf, 3, 4)));
 extern int vsnprintf(char *buf, size_t size, const char *fmt, va_list args);
 
 long simple_strtol(const char *cp,char **endp,unsigned int base);